package com.spzx.channel.Contoller;

import com.spzx.channel.domain.ItemVo;
import com.spzx.channel.service.IItemService;
import com.spzx.common.core.web.domain.AjaxResult;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.servlet.ServletException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * projectName: spzx-parent
 *
 * @author: 王宝贵
 * time: 2024/10/9 19:24 周三
 * description: 查询商品详情接口
 */
@Tag(name = "查询商品详情接口（用户端）")
@RestController
@RequestMapping("/item")

public class ItemController  extends  BrandController{

    @Autowired
    private IItemService itemService;

    /**
     * 查询商品详情信息
     * @param skuId skuId
     * @return
     */
    @Operation(summary = "查询商品详情")
    @GetMapping("/{skuId}")
    public AjaxResult item(@PathVariable Long skuId) throws ServletException {
       ItemVo itemVo = itemService.item(skuId);
       return success(itemVo);
    }

}